﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Last03.Common
{
    class Helps
    {
        //初始化测试数据，演示用（确保演示数据可预测）
        public static void InitTestData()
        {
            using (var c = new HotelEntities())
            {
                //清空表数据
                //var v = c.Database;
                //v.ExecuteSqlCommand("delete from AccountInfo");
                //v.ExecuteSqlCommand("delete from EmployeeInfo");
                //v.ExecuteSqlCommand("delete from LoginInfo");
                //v.ExecuteSqlCommand("delete from MoneyInfo");
                //v.ExecuteSqlCommand("delete from RateInfo");
                ////初始化表数据
                //InitAccountInfo(c);
                //InitEmployeeInfo(c);
                //InitLoginInfo(c);
                //InitMoneyInfo(c);
                //InitRateInfo(c);
                //更新数据库
                //if (!SaveChanges(c, out string errMsg))
                //{
                //    MessageBox.Show($"初始化数据库失败。异常：{errMsg}\n");
                //}
            }
        }
    }
}
